package com.gdut.huayan.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gdut.huayan.validation.NumRange;
import com.gdut.huayan.validation.group.GroupAdd;
import com.gdut.huayan.validation.group.GroupUpdate;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_activity")
public class Activity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Null(groups = {GroupAdd.class})
    @NotNull(groups = {GroupUpdate.class})
    private Long id;

    /**
     * 标题
     */
    @NotBlank(groups = {GroupAdd.class},message = "活动标题不能为空")
    private String title;

    /**
     * 简介
     */
    private String introduce;

    /**
     * 活动类型:1-系统创建，2-用户创建
     */
    @Null(message = "不允许填写系统类型")
    private Integer isSystem;

    /**
     * 随喜类型:1-文书地址，2-不需要地址
     */
    @NumRange(min = 1,max = 2,message = "随喜类型错误")
    private Integer charityType;

    /**
     * 牌位类型:1-延生，2-往生
     */
    @NumRange(min = 1,max = 2,message = "牌位类型错误")
    private Integer tabletType;

    /**
     * 是否是随喜：1-是 。2-不是
     */
    @NumRange(min = 1,max = 2,message = "是否随喜参数错误")
    private Integer isSuiXi;

    /**
     * 往生牌位类型:1-历代，2-先人，3-法界，4-地基
     */
    @NumRange(min = 1,max = 4,message = "往生牌位类型错误")
    private Integer lastType;

}
